<template>
	<view>
		<!-- <u-navbar :is-back="false" title="　" :border-bottom="false">
			<view class="u-flex u-row-right" style="width: 100%;">
				<view class="camera u-flex u-row-center">
					<u-icon name="camera-fill" color="#000000" size="48"></u-icon>
				</view>
			</view>
		</u-navbar> -->
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
			<view class="u-m-r-10">
				<!-- <u-avatar :src="pic" size="140"></u-avatar> -->
				<image :src="userPhoto" mode="" style="width: 90px;" mode="widthFix"></image>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">{{userName}}</view>
				<!-- <view class="u-font-14 u-tips-color">微信号:helang_uView</view> -->
			</view>
			
		</view>
		
		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="lock-open" title="修改密码" @tap="tochangePwd()" ></u-cell-item>	
				</u-cell-item>
			</u-cell-group>
		</view>
		<view class="parent">
			<view class="child">
				<!-- center -->
				<view class="item">
					<button  type="warn" @click="reLogin()">退出</button>
				</view>
			</view>
		</view>
		<!-- {{userPhoto}}{{userCode}} -->
		<v-footer></v-footer>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from 'vuex'
	import footer from '../components/footer/footer.vue'
	
	export default {
		components:{
			'v-footer':footer
		},
		data() {
			return {
				pic:this.userPhoto,
				show:true
			}
		},
		computed: {
			...mapState(['token', 'userCode','userName','userPhoto'])
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title:"个人中心"
			})
		},
		methods: {
			...mapActions(['reLogin', 'getToken', 'hasLogin']),
			tochangePwd(){
				uni.navigateTo({
					url:'/pages/me/changePwd',
					complete(e) {
						console.log(e);
					}
				})
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #ededed;
}

.camera{
	width: 54px;
	height: 44px;
	
	&:active{
		background-color: #ededed;
	}
}
.user-box{
	background-color: #fff;
}

.parent{
	height: 200px;
	// border: 1px solid #EC706B;
	// display: flex;
	// justify-content: center;
	// align-items: center;
	position: relative;
	.child{
		// border: 1px solid #58f523;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		.item{
			width: 99vw;
		}
	}
}

.u-bg-red{
	background-color: #EC706B;
}
</style>
